<?php
header('Content-Type:text/html;charset=gbk');
require_once("db_manage.php");
require_once '../bbs/include/common.inc.php';

// upload dir	
$intro = $_POST['title'];		
$textlink = $_POST['textlink'];
$turn = $_POST['turn'];
$uploaddir = '../upload/images/';
$uploadfile = date('YmdHis');
$filename = basename($_FILES['userfile']['name']);
$path_parts = pathinfo($filename);
$ext = $path_parts["extension"];
$uploadfile = $uploaddir.$uploadfile.".".$ext;
/*
echo $intro;
echo $textlink;
echo turn;

echo $filename;
echo $ext;
echo $uploadfile;
*/
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$uploadfile)){	
	$subject = array($intro,$textlink,$discuz_userss,$turn,$uploadfile);
	addSubject($subject);	
}
echo "<script>location.href='manage_home_special.php';</script>";
/*
$uploadfile = $uploaddir . 'jioj.jpg';
echo $uploadfile;
echo '<pre>';
if (move_uploaded_file($_FILES['imageupload']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
*/
?> 